package com.sky.service.impl;

import com.sky.constant.StatusConstant;
import com.sky.service.ShopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Service;

@Service
public class ShopServiceImpl implements ShopService {
    @Autowired
    RedisTemplate redisTemplate;

    @Override
    public Integer getstatus() {
        ValueOperations valueOperations = redisTemplate.opsForValue();
        Integer result = (Integer) valueOperations.get(StatusConstant.SHOP_STATUS);
        return result;
    }

    public void setstatus(Integer status) {
        ValueOperations valueOperations = redisTemplate.opsForValue();
        valueOperations.set(StatusConstant.SHOP_STATUS, status);
    }
}
